﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Game
{
    namespace RenderTechnique
    {
        class DebugRenderTechnique : OutputTechnique
        {
            public DebugRenderTechnique(TechniqueDescription desc)
                : base(desc)
            {
            }

            public override void Init()
            {
                base.Init();
                //InitOutput();

                {
                    // Step 1.0 : gen gbuffer
                    IDK.ShaderProgram program = Description.Core.GetShaderProgram("DebugShading\\DebugBuffer");
                    mBaseShader = program;
                    // Step 1.1 : add parameter
                    program.AddParameter(IDK.ShaderProgram.Parameter.Type.VertexAttribute, IDK.ShaderProgram.Parameter.Declaration.VertexPosition, "position");
                    program.AddParameter(IDK.ShaderProgram.Parameter.Type.VertexAttribute, IDK.ShaderProgram.Parameter.Declaration.VertexTexCoord, "tcoord");

                    program.AddParameter(IDK.ShaderProgram.Parameter.Type.ConstantParameter, IDK.ShaderProgram.Parameter.Declaration.MatrixProjection, "gProj");
                    program.AddParameter(IDK.ShaderProgram.Parameter.Type.ConstantParameter, IDK.ShaderProgram.Parameter.Declaration.MatrixView, "gView");
                    program.AddParameter(IDK.ShaderProgram.Parameter.Type.ConstantParameter, IDK.ShaderProgram.Parameter.Declaration.MatrixWorld, "gWorld");


                    program.AddParameter(IDK.ShaderProgram.Parameter.Type.ConstantParameter, IDK.ShaderProgram.Parameter.Declaration.Texture0, "decalMap");

                    Description.Renderer.AddPass(new IDK.DebugShadingBufferPass(Description.Core.GetScene(),
                        /*cam*/Description.Camera));
                }
            }
        }
    }
}
